package JianZhiOffer;

/**
 * @Author: huangkunming
 * @Date: 2023/7/3 9:13
 * @Description:
 */
public class Solution27 {

    public static int minImpossibleOR(int[] nums) {
        int s = 0;
        for (int i = 0; i < nums.length; i++) {
            s |= nums[i];
        }

        int temp = 1;
        while (true) {
            if ((s ^ temp) != 0) {
                temp = temp << 1;
                continue;
            }
            return 2 ^ (temp - 1);
        }
    }

    public static void main(String[] args) {
        System.out.println(minImpossibleOR(new int[]{2, 5}));
    }
}
